<!DOCTYPE HTML>
<html lang="en" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>css选择符及用法 | 个人笔记</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.7">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-search/search.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../../md/css/CSS属性.html" />
    
    
    <link rel="prev" href="../../md/css/css语法结构及引入方式.html" />
    

        
    </head>
    <body>
        
        
    <div class="book"
        data-level="2.2"
        data-chapter-title="css选择符及用法"
        data-filepath="md/css/css选择符及用法.md"
        data-basepath="../.."
        data-revision="Thu Jun 07 2018 19:36:00 GMT+0800 (中国标准时间)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        Introduction
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="md/gitbook的安装.html">
            
                
                    <a href="../../md/gitbook的安装.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        gitbook的安装
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2" data-path="md/css/CSS的认识.html">
            
                
                    <a href="../../md/css/CSS的认识.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        CSS
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="md/css/css语法结构及引入方式.html">
            
                
                    <a href="../../md/css/css语法结构及引入方式.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        css语法结构及引入方式
                    </a>
            
            
        </li>
    
        <li class="chapter active" data-level="2.2" data-path="md/css/css选择符及用法.html">
            
                
                    <a href="../../md/css/css选择符及用法.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        css选择符及用法
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="md/css/CSS属性.html">
            
                
                    <a href="../../md/css/CSS属性.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        CSS属性
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.3.1" data-path="md/css/背景属性.html">
            
                
                    <a href="../../md/css/背景属性.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.1.</b>
                        
                        背景属性
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.3.2" data-path="md/css/字体属性.html">
            
                
                    <a href="../../md/css/字体属性.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.2.</b>
                        
                        字体属性
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../../" >个人笔记</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="&#x9009;&#x62E9;&#x7B26;-&#xFF1A;">&#x9009;&#x62E9;&#x7B26; &#xFF1A;</h1>
<h3 id="1&#x3001;&#x5143;&#x7D20;&#x9009;&#x62E9;&#x7B26;&#x5668;&#xFF1A;&#x76F4;&#x63A5;&#x628A;&#x5143;&#x7D20;&#x540D;&#x5F53;&#x505A;&#x9009;&#x62E9;&#x7B26;&#xFF0C;&#x6BD4;&#x5982;&#xFF1A;div">1&#x3001;&#x5143;&#x7D20;&#x9009;&#x62E9;&#x7B26;/&#x5668;&#xFF1A;&#x76F4;&#x63A5;&#x628A;&#x5143;&#x7D20;&#x540D;&#x5F53;&#x505A;&#x9009;&#x62E9;&#x7B26;&#xFF0C;&#x6BD4;&#x5982;&#xFF1A;div</h3>
<p> &#x4F8B;&#x5B50;&#xFF1A;</p>
<p> index.html</p>
<pre><code>     &lt;h1&gt;&#x6807;&#x9898;&lt;/h1&gt;

    &lt;p&gt;&#x6B63;&#x6587;&#x5185;&#x5BB9;&lt;/p&gt;
</code></pre><p> style.css</p>
<pre><code>     h1 {
        font-size: 18px;
        color: #c82829;
        margin: 10px 0;
    }

    p {
        font-size: 14px;
        color: #718c00;
        margin: 10px 0;
    }
</code></pre><p>&#x8FD0;&#x884C;&#x6548;&#x679C;&#xFF1A;</p>
<p><img src="../../img/2.jpg" alt="&#x7ED3;&#x679C;"></p>
<h3 id="2&#x3001;&#x901A;&#x914D;&#x7B26;&#xFF1A;&#x7528;&#x8868;&#x793A;&#xFF0C;&#x901A;&#x914D;&#x7B26;&#x53EF;&#x4EE5;&#x9009;&#x62E9;&#x5230;&#x6240;&#x6709;&#x7684;&#x5143;&#x7D20;&#x3002;">2&#x3001;&#x901A;&#x914D;&#x7B26;&#xFF1A;&#x7528;*&#x8868;&#x793A;&#xFF0C;&#x901A;&#x914D;&#x7B26;&#x53EF;&#x4EE5;&#x9009;&#x62E9;&#x5230;&#x6240;&#x6709;&#x7684;&#x5143;&#x7D20;&#x3002;</h3>
<p> &#x4F8B;&#x5B50;&#xFF1A;</p>
<p> index.htm</p>
<pre><code>     &lt;h1&gt;&#x6807;&#x9898;&lt;/h1&gt;

    &lt;p&gt;&#x6B63;&#x6587;&#x5185;&#x5BB9;&lt;/p&gt;
</code></pre><p>style.css</p>
<pre><code>* {
    color: #c82829;
    margin: 10px 0;
}
</code></pre><p>&#x8FD0;&#x884C;&#x6548;&#x679C;&#xFF1A;</p>
<p><img src="../../img/3.jpg" alt="&#x6548;&#x679C;"></p>
<h3 id="3&#x3001;&#x7C7B;&#x540D;&#x9009;&#x62E9;&#x7B26;&#xFF1A;&#x7528;class&#x6765;&#x5B9A;&#x4E49;&#xFF0C;&#x5728;css&#x4E2D;&#x7528;&#x70B9;&#xFF08;&#xFF09;&#x6765;&#x8868;&#x793A;&#x7C7B;&#xFF0C;&#x7C7B;&#x540D;&#x662F;&#x53EF;&#x4EE5;&#x91CD;&#x590D;&#x4F7F;&#x7528;&#x7684;">3&#x3001;&#x7C7B;&#x540D;&#x9009;&#x62E9;&#x7B26;&#xFF1A;&#x7528;class&#x6765;&#x5B9A;&#x4E49;&#xFF0C;&#x5728;css&#x4E2D;&#x7528;&#x70B9;&#xFF08;.&#xFF09;&#x6765;&#x8868;&#x793A;&#x7C7B;&#xFF0C;&#x7C7B;&#x540D;&#x662F;&#x53EF;&#x4EE5;&#x91CD;&#x590D;&#x4F7F;&#x7528;&#x7684;</h3>
<p> index.html</p>
<pre><code>     &lt;p class=&quot;demo_1&quot;&gt;&#x6B63;&#x6587;&#x5185;&#x5BB9; class=&quot;demo_1&quot;&lt;/p&gt;

    &lt;p class=&quot;demo_1 demo_2&quot;&gt;&#x6B63;&#x6587;&#x5185;&#x5BB9; class=&quot;demo_1 demo_2&quot;&lt;/p&gt;
</code></pre><p> style.css</p>
<pre><code>     .demo_1 {
        color: #0000ff;
    }

    .demo_2 {
        font-weight: bold;
    }
</code></pre><p>&#x8FD0;&#x884C;&#x6548;&#x679C;&#xFF1A;</p>
<p><img src="../../img/4.jpg" alt="&#x6548;&#x679C;"></p>
<h3 id="4&#x3001;id&#x9009;&#x62E9;&#x5668;&#xFF1A;&#x7528;id&#x6765;&#x5B9A;&#x4E49;&#x5728;css&#x4E2D;&#x7528;&#x53F7;&#x6765;&#x8868;&#x793A;id&#xFF0C;id&#x662F;&#x552F;&#x4E00;&#x7684;&#x4E0D;&#x80FD;&#x91CD;&#x590D;&#x4F7F;&#x7528;">4&#x3001;id&#x9009;&#x62E9;&#x5668;&#xFF1A;&#x7528;id&#x6765;&#x5B9A;&#x4E49;,&#x5728;css&#x4E2D;&#x7528;#&#x53F7;&#x6765;&#x8868;&#x793A;id&#xFF0C;id&#x662F;&#x552F;&#x4E00;&#x7684;&#x4E0D;&#x80FD;&#x91CD;&#x590D;&#x4F7F;&#x7528;</h3>
<p> index.html</p>
<pre><code>    &lt;p id=&quot;demo_1&quot;&gt;&#x6B63;&#x6587;&#x5185;&#x5BB9; id=&quot;demo_1&quot;&lt;/p&gt;
</code></pre><p> style.css</p>
<pre><code>    #demo_1 {
        font-size: 20px;
    }
</code></pre><p>&#x8FD0;&#x884C;&#x6548;&#x679C;&#xFF1A;</p>
<p><img src="../../img/5.jpg" alt="&#x6548;&#x679C;"></p>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../../md/css/css语法结构及引入方式.html" class="navigation navigation-prev " aria-label="Previous page: css语法结构及引入方式"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../../md/css/CSS属性.html" class="navigation navigation-next " aria-label="Next page: CSS属性"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../../gitbook/app.js"></script>

    
    <script src="../../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-search/search.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-livereload/plugin.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"livereload":{}};
    gitbook.start(config);
});
</script>

        
    </body>
    
</html>
